import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

/**
 * 用户实体，用于数据库存储用户信息
 */
@Entity('users')
export class User {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ unique: true })
  username: string;

  @Column()
  password: string;

  @Column({ nullable: true })
  email?: string;

  @Column('simple-json')
  roles: string[];
}